import {
    a7 as Teleport,
    aa as mergeProps,
    ab as inject,
    ai as useId,
    aj as cloneVNode,
    ak as onUnmounted,
    al as provide,
    am as getCurrentInstance,
    b as createBaseVNode,
    C as reactive,
    c as createBlock,
    d as defineComponent,
    e as ref,
    f as computed,
    F as Fragment,
    I as renderSlot,
    J as mergeModels,
    K as onMounted,
    k as createCommentVNode,
    m as useModel,
    o as openBlock,
    p as withCtx,
    Q as h$1,
    q as createVNode,
    T as shallowRef,
    U as watchEffect,
    u as unref,
    V as nextTick,
    w as watch
} from "./index-Dfdf_Rjk.js";

function t$4(e2) {
    typeof queueMicrotask == "function" ? queueMicrotask(e2) : Promise.resolve().then(e2).catch((o2) => setTimeout(() => {
        throw o2;
    }));
}

function o$3() {
    let a2 = [], s3 = {
        addEventListener(e2, t2, r2, i2) {
            return e2.addEventListener(t2, r2, i2), s3.add(() => e2.removeEventListener(t2, r2, i2));
        }, requestAnimationFrame(...e2) {
            let t2 = requestAnimationFrame(...e2);
            s3.add(() => cancelAnimationFrame(t2));
        }, nextFrame(...e2) {
            s3.requestAnimationFrame(() => {
                s3.requestAnimationFrame(...e2);
            });
        }, setTimeout(...e2) {
            let t2 = setTimeout(...e2);
            s3.add(() => clearTimeout(t2));
        }, microTask(...e2) {
            let t2 = {current: true};
            return t$4(() => {
                t2.current && e2[0]();
            }), s3.add(() => {
                t2.current = false;
            });
        }, style(e2, t2, r2) {
            let i2 = e2.style.getPropertyValue(t2);
            return Object.assign(e2.style, {[t2]: r2}), this.add(() => {
                Object.assign(e2.style, {[t2]: i2});
            });
        }, group(e2) {
            let t2 = o$3();
            return e2(t2), this.add(() => t2.dispose());
        }, add(e2) {
            return a2.push(e2), () => {
                let t2 = a2.indexOf(e2);
                if (t2 >= 0) for (let r2 of a2.splice(t2, 1)) r2();
            };
        }, dispose() {
            for (let e2 of a2.splice(0)) e2();
        }
    };
    return s3;
}

var r;
let n$4 = Symbol("headlessui.useid"), o$2 = 0;
const i$5 = (r = useId) != null ? r : function () {
    return inject(n$4, () => "".concat(++o$2))();
};

function o$1(e2) {
    var l2;
    if (e2 == null || e2.value == null) return null;
    let n2 = (l2 = e2.value.$el) != null ? l2 : e2.value;
    return n2 instanceof Node ? n2 : null;
}

function u$5(r2, n2, ...a2) {
    if (r2 in n2) {
        let e2 = n2[r2];
        return typeof e2 == "function" ? e2(...a2) : e2;
    }
    let t2 = new Error('Tried to handle "'.concat(r2, '" but there is no handler defined. Only defined handlers are: ').concat(Object.keys(n2).map((e2) => '"'.concat(e2, '"')).join(", "), "."));
    throw Error.captureStackTrace && Error.captureStackTrace(t2, u$5), t2;
}

var i$4 = Object.defineProperty;
var d$3 = (t2, e2, r2) => e2 in t2 ? i$4(t2, e2, {
    enumerable: true,
    configurable: true,
    writable: true,
    value: r2
}) : t2[e2] = r2;
var n$3 = (t2, e2, r2) => (d$3(t2, typeof e2 != "symbol" ? e2 + "" : e2, r2), r2);
let s$2 = class s {
    constructor() {
        n$3(this, "current", this.detect());
        n$3(this, "currentId", 0);
    }

    get isServer() {
        return this.current === "server";
    }

    get isClient() {
        return this.current === "client";
    }

    set(e2) {
        this.current !== e2 && (this.currentId = 0, this.current = e2);
    }

    reset() {
        this.set(this.detect());
    }

    nextId() {
        return ++this.currentId;
    }

    detect() {
        return typeof window == "undefined" || typeof document == "undefined" ? "server" : "client";
    }
};
let c$2 = new s$2();

function i$3(r2) {
    if (c$2.isServer) return null;
    if (r2 instanceof Node) return r2.ownerDocument;
    if (r2 != null && r2.hasOwnProperty("value")) {
        let n2 = o$1(r2);
        if (n2) return n2.ownerDocument;
    }
    return document;
}

let c$1 = ["[contentEditable=true]", "[tabindex]", "a[href]", "area[href]", "button:not([disabled])", "iframe", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])"].map((e2) => "".concat(e2, ":not([tabindex='-1'])")).join(",");
var N$3 = ((n2) => (n2[n2.First = 1] = "First", n2[n2.Previous = 2] = "Previous", n2[n2.Next = 4] = "Next", n2[n2.Last = 8] = "Last", n2[n2.WrapAround = 16] = "WrapAround", n2[n2.NoScroll = 32] = "NoScroll", n2))(N$3 || {}),
    T$2 = ((o2) => (o2[o2.Error = 0] = "Error", o2[o2.Overflow = 1] = "Overflow", o2[o2.Success = 2] = "Success", o2[o2.Underflow = 3] = "Underflow", o2))(T$2 || {}),
    F = ((t2) => (t2[t2.Previous = -1] = "Previous", t2[t2.Next = 1] = "Next", t2))(F || {});

function E$2(e2 = document.body) {
    return e2 == null ? [] : Array.from(e2.querySelectorAll(c$1)).sort((r2, t2) => Math.sign((r2.tabIndex || Number.MAX_SAFE_INTEGER) - (t2.tabIndex || Number.MAX_SAFE_INTEGER)));
}

var h = ((t2) => (t2[t2.Strict = 0] = "Strict", t2[t2.Loose = 1] = "Loose", t2))(h || {});

function w$3(e2, r2 = 0) {
    var t2;
    return e2 === ((t2 = i$3(e2)) == null ? void 0 : t2.body) ? false : u$5(r2, {
        [0]() {
            return e2.matches(c$1);
        }, [1]() {
            let l2 = e2;
            for (; l2 !== null;) {
                if (l2.matches(c$1)) return true;
                l2 = l2.parentElement;
            }
            return false;
        }
    });
}

var y$2 = ((t2) => (t2[t2.Keyboard = 0] = "Keyboard", t2[t2.Mouse = 1] = "Mouse", t2))(y$2 || {});
typeof window != "undefined" && typeof document != "undefined" && (document.addEventListener("keydown", (e2) => {
    e2.metaKey || e2.altKey || e2.ctrlKey || (document.documentElement.dataset.headlessuiFocusVisible = "");
}, true), document.addEventListener("click", (e2) => {
    e2.detail === 1 ? delete document.documentElement.dataset.headlessuiFocusVisible : e2.detail === 0 && (document.documentElement.dataset.headlessuiFocusVisible = "");
}, true));

function S$1(e2) {
    e2 == null || e2.focus({preventScroll: true});
}

let H$2 = ["textarea", "input"].join(",");

function I(e2) {
    var r2, t2;
    return (t2 = (r2 = e2 == null ? void 0 : e2.matches) == null ? void 0 : r2.call(e2, H$2)) != null ? t2 : false;
}

function O(e2, r2 = (t2) => t2) {
    return e2.slice().sort((t2, l2) => {
        let o2 = r2(t2), i2 = r2(l2);
        if (o2 === null || i2 === null) return 0;
        let n2 = o2.compareDocumentPosition(i2);
        return n2 & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : n2 & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
    });
}

function P(e2, r2, {sorted: t2 = true, relativeTo: l2 = null, skipElements: o2 = []} = {}) {
    var m2;
    let i2 = (m2 = Array.isArray(e2) ? e2.length > 0 ? e2[0].ownerDocument : document : e2 == null ? void 0 : e2.ownerDocument) != null ? m2 : document,
        n2 = Array.isArray(e2) ? t2 ? O(e2) : e2 : E$2(e2);
    o2.length > 0 && n2.length > 1 && (n2 = n2.filter((s3) => !o2.includes(s3))), l2 = l2 != null ? l2 : i2.activeElement;
    let x2 = (() => {
        if (r2 & 5) return 1;
        if (r2 & 10) return -1;
        throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
    })(), p = (() => {
        if (r2 & 1) return 0;
        if (r2 & 2) return Math.max(0, n2.indexOf(l2)) - 1;
        if (r2 & 4) return Math.max(0, n2.indexOf(l2)) + 1;
        if (r2 & 8) return n2.length - 1;
        throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
    })(), L = r2 & 32 ? {preventScroll: true} : {}, a2 = 0, d2 = n2.length, u2;
    do {
        if (a2 >= d2 || a2 + d2 <= 0) return 0;
        let s3 = p + a2;
        if (r2 & 16) s3 = (s3 + d2) % d2;
        else {
            if (s3 < 0) return 3;
            if (s3 >= d2) return 1;
        }
        u2 = n2[s3], u2 == null || u2.focus(L), a2 += x2;
    } while (u2 !== i2.activeElement);
    return r2 & 6 && I(u2) && u2.select(), 2;
}

function t$3() {
    return /iPhone/gi.test(window.navigator.platform) || /Mac/gi.test(window.navigator.platform) && window.navigator.maxTouchPoints > 0;
}

function i$2() {
    return /Android/gi.test(window.navigator.userAgent);
}

function n$2() {
    return t$3() || i$2();
}

function u$4(e2, t2, n2) {
    c$2.isServer || watchEffect((o2) => {
        document.addEventListener(e2, t2, n2), o2(() => document.removeEventListener(e2, t2, n2));
    });
}

function w$2(e2, n2, t2) {
    c$2.isServer || watchEffect((o2) => {
        window.addEventListener(e2, n2, t2), o2(() => window.removeEventListener(e2, n2, t2));
    });
}

function w$1(f2, m2, l2 = computed(() => true)) {
    function a2(e2, r2) {
        if (!l2.value || e2.defaultPrevented) return;
        let t2 = r2(e2);
        if (t2 === null || !t2.getRootNode().contains(t2)) return;
        let c2 = function o2(n2) {
            return typeof n2 == "function" ? o2(n2()) : Array.isArray(n2) || n2 instanceof Set ? n2 : [n2];
        }(f2);
        for (let o2 of c2) {
            if (o2 === null) continue;
            let n2 = o2 instanceof HTMLElement ? o2 : o$1(o2);
            if (n2 != null && n2.contains(t2) || e2.composed && e2.composedPath().includes(n2)) return;
        }
        return !w$3(t2, h.Loose) && t2.tabIndex !== -1 && e2.preventDefault(), m2(e2, t2);
    }

    let u2 = ref(null);
    u$4("pointerdown", (e2) => {
        var r2, t2;
        l2.value && (u2.value = ((t2 = (r2 = e2.composedPath) == null ? void 0 : r2.call(e2)) == null ? void 0 : t2[0]) || e2.target);
    }, true), u$4("mousedown", (e2) => {
        var r2, t2;
        l2.value && (u2.value = ((t2 = (r2 = e2.composedPath) == null ? void 0 : r2.call(e2)) == null ? void 0 : t2[0]) || e2.target);
    }, true), u$4("click", (e2) => {
        n$2() || u2.value && (a2(e2, () => u2.value), u2.value = null);
    }, true), u$4("touchend", (e2) => a2(e2, () => e2.target instanceof HTMLElement ? e2.target : null), true), w$2("blur", (e2) => a2(e2, () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null), true);
}

var N$2 = ((o2) => (o2[o2.None = 0] = "None", o2[o2.RenderStrategy = 1] = "RenderStrategy", o2[o2.Static = 2] = "Static", o2))(N$2 || {}),
    S = ((e2) => (e2[e2.Unmount = 0] = "Unmount", e2[e2.Hidden = 1] = "Hidden", e2))(S || {});

function A$2({visible: r2 = true, features: t2 = 0, ourProps: e2, theirProps: o2, ...i2}) {
    var a2;
    let n2 = j(o2, e2), l2 = Object.assign(i2, {props: n2});
    if (r2 || t2 & 2 && n2.static) return y$1(l2);
    if (t2 & 1) {
        let d2 = (a2 = n2.unmount) == null || a2 ? 0 : 1;
        return u$5(d2, {
            [0]() {
                return null;
            }, [1]() {
                return y$1({...i2, props: {...n2, hidden: true, style: {display: "none"}}});
            }
        });
    }
    return y$1(l2);
}

function y$1({props: r2, attrs: t2, slots: e2, slot: o2, name: i2}) {
    var m2, h2;
    let {as: n2, ...l2} = T$1(r2, ["unmount", "static"]), a2 = (m2 = e2.default) == null ? void 0 : m2.call(e2, o2),
        d2 = {};
    if (o2) {
        let u2 = false, c2 = [];
        for (let [p, f2] of Object.entries(o2)) typeof f2 == "boolean" && (u2 = true), f2 === true && c2.push(p);
        u2 && (d2["data-headlessui-state"] = c2.join(" "));
    }
    if (n2 === "template") {
        if (a2 = b(a2 != null ? a2 : []), Object.keys(l2).length > 0 || Object.keys(t2).length > 0) {
            let [u2, ...c2] = a2 != null ? a2 : [];
            if (!v(u2) || c2.length > 0) throw new Error(['Passing props on "template"!', "", "The current component <".concat(i2, ' /> is rendering a "template".'), "However we need to passthrough the following props:", Object.keys(l2).concat(Object.keys(t2)).map((s3) => s3.trim()).filter((s3, g, R2) => R2.indexOf(s3) === g).sort((s3, g) => s3.localeCompare(g)).map((s3) => "  - ".concat(s3)).join("\n"), "", "You can apply a few solutions:", ['Add an `as="..."` prop, to ensure that we render an actual element instead of a "template".', "Render a single element as the child so that we can forward the props onto that element."].map((s3) => "  - ".concat(s3)).join("\n")].join("\n"));
            let p = j((h2 = u2.props) != null ? h2 : {}, l2, d2), f2 = cloneVNode(u2, p, true);
            for (let s3 in p) s3.startsWith("on") && (f2.props || (f2.props = {}), f2.props[s3] = p[s3]);
            return f2;
        }
        return Array.isArray(a2) && a2.length === 1 ? a2[0] : a2;
    }
    return h$1(n2, Object.assign({}, l2, d2), {default: () => a2});
}

function b(r2) {
    return r2.flatMap((t2) => t2.type === Fragment ? b(t2.children) : [t2]);
}

function j(...r2) {
    if (r2.length === 0) return {};
    if (r2.length === 1) return r2[0];
    let t2 = {}, e2 = {};
    for (let i2 of r2) for (let n2 in i2) n2.startsWith("on") && typeof i2[n2] == "function" ? (e2[n2] != null || (e2[n2] = []), e2[n2].push(i2[n2])) : t2[n2] = i2[n2];
    if (t2.disabled || t2["aria-disabled"]) return Object.assign(t2, Object.fromEntries(Object.keys(e2).map((i2) => [i2, void 0])));
    for (let i2 in e2) Object.assign(t2, {
        [i2](n2, ...l2) {
            let a2 = e2[i2];
            for (let d2 of a2) {
                if (n2 instanceof Event && n2.defaultPrevented) return;
                d2(n2, ...l2);
            }
        }
    });
    return t2;
}

function T$1(r2, t2 = []) {
    let e2 = Object.assign({}, r2);
    for (let o2 of t2) o2 in e2 && delete e2[o2];
    return e2;
}

function v(r2) {
    return r2 == null ? false : typeof r2.type == "string" || typeof r2.type == "object" || typeof r2.type == "function";
}

var u$3 = ((e2) => (e2[e2.None = 1] = "None", e2[e2.Focusable = 2] = "Focusable", e2[e2.Hidden = 4] = "Hidden", e2))(u$3 || {});
let f$1 = defineComponent({
    name: "Hidden",
    props: {as: {type: [Object, String], default: "div"}, features: {type: Number, default: 1}},
    setup(t2, {slots: n2, attrs: i2}) {
        return () => {
            var r2;
            let {features: e2, ...d2} = t2, o2 = {
                "aria-hidden": (e2 & 2) === 2 ? true : (r2 = d2["aria-hidden"]) != null ? r2 : void 0,
                hidden: (e2 & 4) === 4 ? true : void 0,
                style: {
                    position: "fixed",
                    top: 1,
                    left: 1,
                    width: 1,
                    height: 0,
                    padding: 0,
                    margin: -1,
                    overflow: "hidden",
                    clip: "rect(0, 0, 0, 0)",
                    whiteSpace: "nowrap",
                    borderWidth: "0", ...(e2 & 4) === 4 && (e2 & 2) !== 2 && {display: "none"}
                }
            };
            return A$2({ourProps: o2, theirProps: d2, slot: {}, attrs: i2, slots: n2, name: "Hidden"});
        };
    }
});
let n$1 = Symbol("Context");
var i$1 = ((e2) => (e2[e2.Open = 1] = "Open", e2[e2.Closed = 2] = "Closed", e2[e2.Closing = 4] = "Closing", e2[e2.Opening = 8] = "Opening", e2))(i$1 || {});

function l$1() {
    return inject(n$1, null);
}

var o = ((r2) => (r2.Space = " ", r2.Enter = "Enter", r2.Escape = "Escape", r2.Backspace = "Backspace", r2.Delete = "Delete", r2.ArrowLeft = "ArrowLeft", r2.ArrowUp = "ArrowUp", r2.ArrowRight = "ArrowRight", r2.ArrowDown = "ArrowDown", r2.Home = "Home", r2.End = "End", r2.PageUp = "PageUp", r2.PageDown = "PageDown", r2.Tab = "Tab", r2))(o || {});

function t$2(n2) {
    function e2() {
        document.readyState !== "loading" && (n2(), document.removeEventListener("DOMContentLoaded", e2));
    }

    typeof window != "undefined" && typeof document != "undefined" && (document.addEventListener("DOMContentLoaded", e2), e2());
}

let t$1 = [];
t$2(() => {
    function e2(n2) {
        n2.target instanceof HTMLElement && n2.target !== document.body && t$1[0] !== n2.target && (t$1.unshift(n2.target), t$1 = t$1.filter((r2) => r2 != null && r2.isConnected), t$1.splice(10));
    }

    window.addEventListener("click", e2, {capture: true}), window.addEventListener("mousedown", e2, {capture: true}), window.addEventListener("focus", e2, {capture: true}), document.body.addEventListener("click", e2, {capture: true}), document.body.addEventListener("mousedown", e2, {capture: true}), document.body.addEventListener("focus", e2, {capture: true});
});

function E$1(n2, e2, o2, r2) {
    c$2.isServer || watchEffect((t2) => {
        n2 = n2 != null ? n2 : window, n2.addEventListener(e2, o2, r2), t2(() => n2.removeEventListener(e2, o2, r2));
    });
}

var d$2 = ((r2) => (r2[r2.Forwards = 0] = "Forwards", r2[r2.Backwards = 1] = "Backwards", r2))(d$2 || {});

function n() {
    let o2 = ref(0);
    return w$2("keydown", (e2) => {
        e2.key === "Tab" && (o2.value = e2.shiftKey ? 1 : 0);
    }), o2;
}

function B(t2) {
    if (!t2) return /* @__PURE__ */ new Set();
    if (typeof t2 == "function") return new Set(t2());
    let n2 = /* @__PURE__ */ new Set();
    for (let r2 of t2.value) {
        let l2 = o$1(r2);
        l2 instanceof HTMLElement && n2.add(l2);
    }
    return n2;
}

var A$1 = ((e2) => (e2[e2.None = 1] = "None", e2[e2.InitialFocus = 2] = "InitialFocus", e2[e2.TabLock = 4] = "TabLock", e2[e2.FocusLock = 8] = "FocusLock", e2[e2.RestoreFocus = 16] = "RestoreFocus", e2[e2.All = 30] = "All", e2))(A$1 || {});
let ue = Object.assign(defineComponent({
    name: "FocusTrap",
    props: {
        as: {type: [Object, String], default: "div"},
        initialFocus: {type: Object, default: null},
        features: {type: Number, default: 30},
        containers: {type: [Object, Function], default: ref(/* @__PURE__ */ new Set())}
    },
    inheritAttrs: false,
    setup(t2, {attrs: n$12, slots: r2, expose: l2}) {
        let o2 = ref(null);
        l2({el: o2, $el: o2});
        let i2 = computed(() => i$3(o2)), e2 = ref(false);
        onMounted(() => e2.value = true), onUnmounted(() => e2.value = false), $$1({ownerDocument: i2}, computed(() => e2.value && Boolean(t2.features & 16)));
        let m2 = z$1({
            ownerDocument: i2,
            container: o2,
            initialFocus: computed(() => t2.initialFocus)
        }, computed(() => e2.value && Boolean(t2.features & 2)));
        J({
            ownerDocument: i2,
            container: o2,
            containers: t2.containers,
            previousActiveElement: m2
        }, computed(() => e2.value && Boolean(t2.features & 8)));
        let f2 = n();

        function a2(u2) {
            let T2 = o$1(o2);
            if (!T2) return;
            ((w2) => w2())(() => {
                u$5(f2.value, {
                    [d$2.Forwards]: () => {
                        P(T2, N$3.First, {skipElements: [u2.relatedTarget]});
                    }, [d$2.Backwards]: () => {
                        P(T2, N$3.Last, {skipElements: [u2.relatedTarget]});
                    }
                });
            });
        }

        let s3 = ref(false);

        function F2(u2) {
            u2.key === "Tab" && (s3.value = true, requestAnimationFrame(() => {
                s3.value = false;
            }));
        }

        function H2(u2) {
            if (!e2.value) return;
            let T2 = B(t2.containers);
            o$1(o2) instanceof HTMLElement && T2.add(o$1(o2));
            let d2 = u2.relatedTarget;
            d2 instanceof HTMLElement && d2.dataset.headlessuiFocusGuard !== "true" && (N$1(T2, d2) || (s3.value ? P(o$1(o2), u$5(f2.value, {
                [d$2.Forwards]: () => N$3.Next,
                [d$2.Backwards]: () => N$3.Previous
            }) | N$3.WrapAround, {relativeTo: u2.target}) : u2.target instanceof HTMLElement && S$1(u2.target)));
        }

        return () => {
            let u2 = {}, T2 = {ref: o2, onKeydown: F2, onFocusout: H2}, {
                features: d2,
                initialFocus: w2,
                containers: Q,
                ...O2
            } = t2;
            return h$1(Fragment, [Boolean(d2 & 4) && h$1(f$1, {
                as: "button",
                type: "button",
                "data-headlessui-focus-guard": true,
                onFocus: a2,
                features: u$3.Focusable
            }), A$2({
                ourProps: T2,
                theirProps: {...n$12, ...O2},
                slot: u2,
                attrs: n$12,
                slots: r2,
                name: "FocusTrap"
            }), Boolean(d2 & 4) && h$1(f$1, {
                as: "button",
                type: "button",
                "data-headlessui-focus-guard": true,
                onFocus: a2,
                features: u$3.Focusable
            })]);
        };
    }
}), {features: A$1});

function W(t2) {
    let n2 = ref(t$1.slice());
    return watch([t2], ([r2], [l2]) => {
        l2 === true && r2 === false ? t$4(() => {
            n2.value.splice(0);
        }) : l2 === false && r2 === true && (n2.value = t$1.slice());
    }, {flush: "post"}), () => {
        var r2;
        return (r2 = n2.value.find((l2) => l2 != null && l2.isConnected)) != null ? r2 : null;
    };
}

function $$1({ownerDocument: t2}, n2) {
    let r2 = W(n2);
    onMounted(() => {
        watchEffect(() => {
            var l2, o2;
            n2.value || ((l2 = t2.value) == null ? void 0 : l2.activeElement) === ((o2 = t2.value) == null ? void 0 : o2.body) && S$1(r2());
        }, {flush: "post"});
    }), onUnmounted(() => {
        n2.value && S$1(r2());
    });
}

function z$1({ownerDocument: t2, container: n2, initialFocus: r2}, l2) {
    let o2 = ref(null), i2 = ref(false);
    return onMounted(() => i2.value = true), onUnmounted(() => i2.value = false), onMounted(() => {
        watch([n2, r2, l2], (e2, m2) => {
            if (e2.every((a2, s3) => (m2 == null ? void 0 : m2[s3]) === a2) || !l2.value) return;
            let f2 = o$1(n2);
            f2 && t$4(() => {
                var F2, H2;
                if (!i2.value) return;
                let a2 = o$1(r2), s3 = (F2 = t2.value) == null ? void 0 : F2.activeElement;
                if (a2) {
                    if (a2 === s3) {
                        o2.value = s3;
                        return;
                    }
                } else if (f2.contains(s3)) {
                    o2.value = s3;
                    return;
                }
                a2 ? S$1(a2) : P(f2, N$3.First | N$3.NoScroll) === T$2.Error && console.warn("There are no focusable elements inside the <FocusTrap />"), o2.value = (H2 = t2.value) == null ? void 0 : H2.activeElement;
            });
        }, {immediate: true, flush: "post"});
    }), o2;
}

function J({ownerDocument: t2, container: n2, containers: r2, previousActiveElement: l2}, o2) {
    var i2;
    E$1((i2 = t2.value) == null ? void 0 : i2.defaultView, "focus", (e2) => {
        if (!o2.value) return;
        let m2 = B(r2);
        o$1(n2) instanceof HTMLElement && m2.add(o$1(n2));
        let f2 = l2.value;
        if (!f2) return;
        let a2 = e2.target;
        a2 && a2 instanceof HTMLElement ? N$1(m2, a2) ? (l2.value = a2, S$1(a2)) : (e2.preventDefault(), e2.stopPropagation(), S$1(f2)) : S$1(l2.value);
    }, true);
}

function N$1(t2, n2) {
    for (let r2 of t2) if (r2.contains(n2)) return true;
    return false;
}

function m$1(t2) {
    let e2 = shallowRef(t2.getSnapshot());
    return onUnmounted(t2.subscribe(() => {
        e2.value = t2.getSnapshot();
    })), e2;
}

function a$1(o2, r2) {
    let t2 = o2(), n2 = /* @__PURE__ */ new Set();
    return {
        getSnapshot() {
            return t2;
        }, subscribe(e2) {
            return n2.add(e2), () => n2.delete(e2);
        }, dispatch(e2, ...s3) {
            let i2 = r2[e2].call(t2, ...s3);
            i2 && (t2 = i2, n2.forEach((c2) => c2()));
        }
    };
}

function c() {
    let o2;
    return {
        before({doc: e2}) {
            var l2;
            let n2 = e2.documentElement;
            o2 = ((l2 = e2.defaultView) != null ? l2 : window).innerWidth - n2.clientWidth;
        }, after({doc: e2, d: n2}) {
            let t2 = e2.documentElement, l2 = t2.clientWidth - t2.offsetWidth, r2 = o2 - l2;
            n2.style(t2, "paddingRight", "".concat(r2, "px"));
        }
    };
}

function w() {
    return t$3() ? {
        before({doc: r2, d: n2, meta: c2}) {
            function a2(o2) {
                return c2.containers.flatMap((l2) => l2()).some((l2) => l2.contains(o2));
            }

            n2.microTask(() => {
                var s3;
                if (window.getComputedStyle(r2.documentElement).scrollBehavior !== "auto") {
                    let t2 = o$3();
                    t2.style(r2.documentElement, "scrollBehavior", "auto"), n2.add(() => n2.microTask(() => t2.dispose()));
                }
                let o2 = (s3 = window.scrollY) != null ? s3 : window.pageYOffset, l2 = null;
                n2.addEventListener(r2, "click", (t2) => {
                    if (t2.target instanceof HTMLElement) try {
                        let e2 = t2.target.closest("a");
                        if (!e2) return;
                        let {hash: f2} = new URL(e2.href), i2 = r2.querySelector(f2);
                        i2 && !a2(i2) && (l2 = i2);
                    } catch (e2) {
                    }
                }, true), n2.addEventListener(r2, "touchstart", (t2) => {
                    if (t2.target instanceof HTMLElement) if (a2(t2.target)) {
                        let e2 = t2.target;
                        for (; e2.parentElement && a2(e2.parentElement);) e2 = e2.parentElement;
                        n2.style(e2, "overscrollBehavior", "contain");
                    } else n2.style(t2.target, "touchAction", "none");
                }), n2.addEventListener(r2, "touchmove", (t2) => {
                    if (t2.target instanceof HTMLElement) {
                        if (t2.target.tagName === "INPUT") return;
                        if (a2(t2.target)) {
                            let e2 = t2.target;
                            for (; e2.parentElement && e2.dataset.headlessuiPortal !== "" && !(e2.scrollHeight > e2.clientHeight || e2.scrollWidth > e2.clientWidth);) e2 = e2.parentElement;
                            e2.dataset.headlessuiPortal === "" && t2.preventDefault();
                        } else t2.preventDefault();
                    }
                }, {passive: false}), n2.add(() => {
                    var e2;
                    let t2 = (e2 = window.scrollY) != null ? e2 : window.pageYOffset;
                    o2 !== t2 && window.scrollTo(0, o2), l2 && l2.isConnected && (l2.scrollIntoView({block: "nearest"}), l2 = null);
                });
            });
        }
    } : {};
}

function l() {
    return {
        before({doc: e2, d: o2}) {
            o2.style(e2.documentElement, "overflow", "hidden");
        }
    };
}

function m(e2) {
    let n2 = {};
    for (let t2 of e2) Object.assign(n2, t2(n2));
    return n2;
}

let a = a$1(() => /* @__PURE__ */ new Map(), {
    PUSH(e2, n2) {
        var o2;
        let t2 = (o2 = this.get(e2)) != null ? o2 : {doc: e2, count: 0, d: o$3(), meta: /* @__PURE__ */ new Set()};
        return t2.count++, t2.meta.add(n2), this.set(e2, t2), this;
    }, POP(e2, n2) {
        let t2 = this.get(e2);
        return t2 && (t2.count--, t2.meta.delete(n2)), this;
    }, SCROLL_PREVENT({doc: e2, d: n2, meta: t2}) {
        let o2 = {doc: e2, d: n2, meta: m(t2)}, c$12 = [w(), c(), l()];
        c$12.forEach(({before: r2}) => r2 == null ? void 0 : r2(o2)), c$12.forEach(({after: r2}) => r2 == null ? void 0 : r2(o2));
    }, SCROLL_ALLOW({d: e2}) {
        e2.dispose();
    }, TEARDOWN({doc: e2}) {
        this.delete(e2);
    }
});
a.subscribe(() => {
    let e2 = a.getSnapshot(), n2 = /* @__PURE__ */ new Map();
    for (let [t2] of e2) n2.set(t2, t2.documentElement.style.overflow);
    for (let t2 of e2.values()) {
        let o2 = n2.get(t2.doc) === "hidden", c2 = t2.count !== 0;
        (c2 && !o2 || !c2 && o2) && a.dispatch(t2.count > 0 ? "SCROLL_PREVENT" : "SCROLL_ALLOW", t2), t2.count === 0 && a.dispatch("TEARDOWN", t2);
    }
});

function d$1(t2, a$12, n2) {
    let i2 = m$1(a), l2 = computed(() => {
        let e2 = t2.value ? i2.value.get(t2.value) : void 0;
        return e2 ? e2.count > 0 : false;
    });
    return watch([t2, a$12], ([e2, m2], [r2], o2) => {
        if (!e2 || !m2) return;
        a.dispatch("PUSH", e2, n2);
        let f2 = false;
        o2(() => {
            f2 || (a.dispatch("POP", r2 != null ? r2 : e2, n2), f2 = true);
        });
    }, {immediate: true}), l2;
}

let i = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map();

function E(d2, f2 = ref(true)) {
    watchEffect((o2) => {
        var a2;
        if (!f2.value) return;
        let e2 = o$1(d2);
        if (!e2) return;
        o2(function () {
            var u2;
            if (!e2) return;
            let r2 = (u2 = t.get(e2)) != null ? u2 : 1;
            if (r2 === 1 ? t.delete(e2) : t.set(e2, r2 - 1), r2 !== 1) return;
            let n2 = i.get(e2);
            n2 && (n2["aria-hidden"] === null ? e2.removeAttribute("aria-hidden") : e2.setAttribute("aria-hidden", n2["aria-hidden"]), e2.inert = n2.inert, i.delete(e2));
        });
        let l2 = (a2 = t.get(e2)) != null ? a2 : 0;
        t.set(e2, l2 + 1), l2 === 0 && (i.set(e2, {
            "aria-hidden": e2.getAttribute("aria-hidden"),
            inert: e2.inert
        }), e2.setAttribute("aria-hidden", "true"), e2.inert = true);
    });
}

function N({defaultContainers: o2 = [], portals: i2, mainTreeNodeRef: H2} = {}) {
    let t2 = ref(null), r2 = i$3(t2);

    function u2() {
        var l2, f2, a2;
        let n2 = [];
        for (let e2 of o2) e2 !== null && (e2 instanceof HTMLElement ? n2.push(e2) : "value" in e2 && e2.value instanceof HTMLElement && n2.push(e2.value));
        if (i2 != null && i2.value) for (let e2 of i2.value) n2.push(e2);
        for (let e2 of (l2 = r2 == null ? void 0 : r2.querySelectorAll("html > *, body > *")) != null ? l2 : []) e2 !== document.body && e2 !== document.head && e2 instanceof HTMLElement && e2.id !== "headlessui-portal-root" && (e2.contains(o$1(t2)) || e2.contains((a2 = (f2 = o$1(t2)) == null ? void 0 : f2.getRootNode()) == null ? void 0 : a2.host) || n2.some((M2) => e2.contains(M2)) || n2.push(e2));
        return n2;
    }

    return {
        resolveContainers: u2, contains(n2) {
            return u2().some((l2) => l2.contains(n2));
        }, mainTreeNodeRef: t2, MainTreeNode() {
            return H2 != null ? null : h$1(f$1, {features: u$3.Hidden, ref: t2});
        }
    };
}

let e = Symbol("ForcePortalRootContext");

function s$1() {
    return inject(e, false);
}

let u$2 = defineComponent({
    name: "ForcePortalRoot",
    props: {as: {type: [Object, String], default: "template"}, force: {type: Boolean, default: false}},
    setup(o2, {slots: t2, attrs: r2}) {
        return provide(e, o2.force), () => {
            let {force: f2, ...n2} = o2;
            return A$2({theirProps: n2, ourProps: {}, slot: {}, slots: t2, attrs: r2, name: "ForcePortalRoot"});
        };
    }
});
let u$1 = Symbol("StackContext");
var s2 = ((e2) => (e2[e2.Add = 0] = "Add", e2[e2.Remove = 1] = "Remove", e2))(s2 || {});

function y() {
    return inject(u$1, () => {
    });
}

function R({type: o2, enabled: r2, element: e2, onUpdate: i2}) {
    let a2 = y();

    function t2(...n2) {
        i2 == null || i2(...n2), a2(...n2);
    }

    onMounted(() => {
        watch(r2, (n2, d2) => {
            n2 ? t2(0, o2, e2) : d2 === true && t2(1, o2, e2);
        }, {immediate: true, flush: "sync"});
    }), onUnmounted(() => {
        r2.value && t2(1, o2, e2);
    }), provide(u$1, t2);
}

let u = Symbol("DescriptionContext");

function k({slot: t2 = ref({}), name: o2 = "Description", props: s3 = {}} = {}) {
    let e2 = ref([]);

    function r2(n2) {
        return e2.value.push(n2), () => {
            let i2 = e2.value.indexOf(n2);
            i2 !== -1 && e2.value.splice(i2, 1);
        };
    }

    return provide(u, {
        register: r2,
        slot: t2,
        name: o2,
        props: s3
    }), computed(() => e2.value.length > 0 ? e2.value.join(" ") : void 0);
}

function x(e2) {
    let t2 = i$3(e2);
    if (!t2) {
        if (e2 === null) return null;
        throw new Error("[Headless UI]: Cannot find ownerDocument for contextElement: ".concat(e2));
    }
    let l2 = t2.getElementById("headlessui-portal-root");
    if (l2) return l2;
    let r2 = t2.createElement("div");
    return r2.setAttribute("id", "headlessui-portal-root"), t2.body.appendChild(r2);
}

const f = /* @__PURE__ */ new WeakMap();

function U(e2) {
    var t2;
    return (t2 = f.get(e2)) != null ? t2 : 0;
}

function M(e2, t2) {
    let l2 = t2(U(e2));
    return l2 <= 0 ? f.delete(e2) : f.set(e2, l2), l2;
}

let $ = defineComponent({
    name: "Portal", props: {as: {type: [Object, String], default: "div"}}, setup(e2, {slots: t2, attrs: l2}) {
        let r2 = ref(null), i2 = computed(() => i$3(r2)), o2 = s$1(), u2 = inject(H$1, null),
            n2 = ref(o2 === true || u2 == null ? x(r2.value) : u2.resolveTarget());
        n2.value && M(n2.value, (a2) => a2 + 1);
        let c2 = ref(false);
        onMounted(() => {
            c2.value = true;
        }), watchEffect(() => {
            o2 || u2 != null && (n2.value = u2.resolveTarget());
        });
        let v2 = inject(d, null), g = false, b2 = getCurrentInstance();
        return watch(r2, () => {
            if (g || !v2) return;
            let a2 = o$1(r2);
            a2 && (onUnmounted(v2.register(a2), b2), g = true);
        }), onUnmounted(() => {
            var P2, T2;
            let a2 = (P2 = i2.value) == null ? void 0 : P2.getElementById("headlessui-portal-root");
            !a2 || n2.value !== a2 || M(n2.value, (L) => L - 1) || n2.value.children.length > 0 || (T2 = n2.value.parentElement) == null || T2.removeChild(n2.value);
        }), () => {
            if (!c2.value || n2.value === null) return null;
            let a2 = {ref: r2, "data-headlessui-portal": ""};
            return h$1(Teleport, {to: n2.value}, A$2({
                ourProps: a2,
                theirProps: e2,
                slot: {},
                attrs: l2,
                slots: t2,
                name: "Portal"
            }));
        };
    }
}), d = Symbol("PortalParentContext");

function q() {
    let e2 = inject(d, null), t2 = ref([]);

    function l2(o2) {
        return t2.value.push(o2), e2 && e2.register(o2), () => r2(o2);
    }

    function r2(o2) {
        let u2 = t2.value.indexOf(o2);
        u2 !== -1 && t2.value.splice(u2, 1), e2 && e2.unregister(o2);
    }

    let i2 = {register: l2, unregister: r2, portals: t2};
    return [t2, defineComponent({
        name: "PortalWrapper", setup(o2, {slots: u2}) {
            return provide(d, i2), () => {
                var n2;
                return (n2 = u2.default) == null ? void 0 : n2.call(u2);
            };
        }
    })];
}

let H$1 = Symbol("PortalGroupContext"), z = defineComponent({
    name: "PortalGroup",
    props: {as: {type: [Object, String], default: "template"}, target: {type: Object, default: null}},
    setup(e2, {attrs: t2, slots: l2}) {
        let r2 = reactive({
            resolveTarget() {
                return e2.target;
            }
        });
        return provide(H$1, r2), () => {
            let {target: i2, ...o2} = e2;
            return A$2({theirProps: o2, ourProps: {}, slot: {}, attrs: t2, slots: l2, name: "PortalGroup"});
        };
    }
});
var Te = ((l2) => (l2[l2.Open = 0] = "Open", l2[l2.Closed = 1] = "Closed", l2))(Te || {});
let H = Symbol("DialogContext");

function T(t2) {
    let i2 = inject(H, null);
    if (i2 === null) {
        let l2 = new Error("<".concat(t2, " /> is missing a parent <Dialog /> component."));
        throw Error.captureStackTrace && Error.captureStackTrace(l2, T), l2;
    }
    return i2;
}

let A = "DC8F892D-2EBD-447C-A4C8-A03058436FF4", Ye = defineComponent({
    name: "Dialog",
    inheritAttrs: false,
    props: {
        as: {type: [Object, String], default: "div"},
        static: {type: Boolean, default: false},
        unmount: {type: Boolean, default: true},
        open: {type: [Boolean, String], default: A},
        initialFocus: {type: Object, default: null},
        id: {type: String, default: null},
        role: {type: String, default: "dialog"}
    },
    emits: {close: (t2) => true},
    setup(t2, {emit: i2, attrs: l2, slots: p, expose: s$12}) {
        var q$1, W2;
        let n2 = (q$1 = t2.id) != null ? q$1 : "headlessui-dialog-".concat(i$5()), u2 = ref(false);
        onMounted(() => {
            u2.value = true;
        });
        let r2 = false,
            g = computed(() => t2.role === "dialog" || t2.role === "alertdialog" ? t2.role : (r2 || (r2 = true, console.warn("Invalid role [".concat(g, "] passed to <Dialog />. Only `dialog` and and `alertdialog` are supported. Using `dialog` instead."))), "dialog")),
            D = ref(0), S2 = l$1(),
            R$1 = computed(() => t2.open === A && S2 !== null ? (S2.value & i$1.Open) === i$1.Open : t2.open),
            m2 = ref(null), E$22 = computed(() => i$3(m2));
        if (s$12({
            el: m2,
            $el: m2
        }), !(t2.open !== A || S2 !== null)) throw new Error("You forgot to provide an `open` prop to the `Dialog`.");
        if (typeof R$1.value != "boolean") throw new Error("You provided an `open` prop to the `Dialog`, but the value is not a boolean. Received: ".concat(R$1.value === A ? void 0 : t2.open));
        let c2 = computed(() => u2.value && R$1.value ? 0 : 1), k$1 = computed(() => c2.value === 0),
            w2 = computed(() => D.value > 1), N$12 = inject(H, null) !== null, [Q, X] = q(), {
                resolveContainers: B2,
                mainTreeNodeRef: K,
                MainTreeNode: Z
            } = N({
                portals: Q, defaultContainers: [computed(() => {
                    var e2;
                    return (e2 = h2.panelRef.value) != null ? e2 : m2.value;
                })]
            }), ee = computed(() => w2.value ? "parent" : "leaf"),
            U2 = computed(() => S2 !== null ? (S2.value & i$1.Closing) === i$1.Closing : false),
            te = computed(() => N$12 || U2.value ? false : k$1.value), le = computed(() => {
                var e2, a2, d2;
                return (d2 = Array.from((a2 = (e2 = E$22.value) == null ? void 0 : e2.querySelectorAll("body > *")) != null ? a2 : []).find((f2) => f2.id === "headlessui-portal-root" ? false : f2.contains(o$1(K)) && f2 instanceof HTMLElement)) != null ? d2 : null;
            });
        E(le, te);
        let ae = computed(() => w2.value ? true : k$1.value), oe = computed(() => {
            var e2, a2, d2;
            return (d2 = Array.from((a2 = (e2 = E$22.value) == null ? void 0 : e2.querySelectorAll("[data-headlessui-portal]")) != null ? a2 : []).find((f2) => f2.contains(o$1(K)) && f2 instanceof HTMLElement)) != null ? d2 : null;
        });
        E(oe, ae), R({
            type: "Dialog", enabled: computed(() => c2.value === 0), element: m2, onUpdate: (e2, a2) => {
                if (a2 === "Dialog") return u$5(e2, {[s2.Add]: () => D.value += 1, [s2.Remove]: () => D.value -= 1});
            }
        });
        let re = k({name: "DialogDescription", slot: computed(() => ({open: R$1.value}))}), M2 = ref(null), h2 = {
            titleId: M2, panelRef: ref(null), dialogState: c2, setTitleId(e2) {
                M2.value !== e2 && (M2.value = e2);
            }, close() {
                i2("close", false);
            }
        };
        provide(H, h2);
        let ne = computed(() => !(!k$1.value || w2.value));
        w$1(B2, (e2, a2) => {
            e2.preventDefault(), h2.close(), nextTick(() => a2 == null ? void 0 : a2.focus());
        }, ne);
        let ie = computed(() => !(w2.value || c2.value !== 0));
        E$1((W2 = E$22.value) == null ? void 0 : W2.defaultView, "keydown", (e2) => {
            ie.value && (e2.defaultPrevented || e2.key === o.Escape && (e2.preventDefault(), e2.stopPropagation(), h2.close()));
        });
        let ue$1 = computed(() => !(U2.value || c2.value !== 0 || N$12));
        return d$1(E$22, ue$1, (e2) => {
            var a2;
            return {containers: [...(a2 = e2.containers) != null ? a2 : [], B2]};
        }), watchEffect((e2) => {
            if (c2.value !== 0) return;
            let a2 = o$1(m2);
            if (!a2) return;
            let d2 = new ResizeObserver((f2) => {
                for (let L of f2) {
                    let x2 = L.target.getBoundingClientRect();
                    x2.x === 0 && x2.y === 0 && x2.width === 0 && x2.height === 0 && h2.close();
                }
            });
            d2.observe(a2), e2(() => d2.disconnect());
        }), () => {
            let {open: e2, initialFocus: a2, ...d2} = t2, f2 = {
                ...l2,
                ref: m2,
                id: n2,
                role: g.value,
                "aria-modal": c2.value === 0 ? true : void 0,
                "aria-labelledby": M2.value,
                "aria-describedby": re.value
            }, L = {open: c2.value === 0};
            return h$1(u$2, {force: true}, () => [h$1($, () => h$1(z, {target: m2.value}, () => h$1(u$2, {force: false}, () => h$1(ue, {
                initialFocus: a2,
                containers: B2,
                features: k$1.value ? u$5(ee.value, {
                    parent: ue.features.RestoreFocus,
                    leaf: ue.features.All & ~ue.features.FocusLock
                }) : ue.features.None
            }, () => h$1(X, {}, () => A$2({
                ourProps: f2,
                theirProps: {...d2, ...l2},
                slot: L,
                attrs: l2,
                slots: p,
                visible: c2.value === 0,
                features: N$2.RenderStrategy | N$2.Static,
                name: "Dialog"
            })))))), h$1(Z)]);
        };
    }
}), Ge = defineComponent({
    name: "DialogPanel",
    props: {as: {type: [Object, String], default: "div"}, id: {type: String, default: null}},
    setup(t2, {attrs: i2, slots: l2, expose: p}) {
        var r2;
        let s3 = (r2 = t2.id) != null ? r2 : "headlessui-dialog-panel-".concat(i$5()), n2 = T("DialogPanel");
        p({el: n2.panelRef, $el: n2.panelRef});

        function u2(g) {
            g.stopPropagation();
        }

        return () => {
            let {...g} = t2, D = {id: s3, ref: n2.panelRef, onClick: u2};
            return A$2({
                ourProps: D,
                theirProps: g,
                slot: {open: n2.dialogState.value === 0},
                attrs: i2,
                slots: l2,
                name: "DialogPanel"
            });
        };
    }
});
const _hoisted_1 = {class: "pointer-events-none absolute inset-0 grid place-items-center"};
const __default__ = {
    inheritAttrs: false
};
const _sfc_main = /* @__PURE__ */ defineComponent({
    ...__default__,
    __name: "SimpleDialog",
    props: /* @__PURE__ */ mergeModels({
        notCloseOnClick: {type: Boolean}
    }, {
        "modelValue": {type: Boolean},
        "modelModifiers": {}
    }),
    emits: ["update:modelValue"],
    setup(__props) {
        const isOpen = useModel(__props, "modelValue");
        return (_ctx, _cache) => {
            return isOpen.value ? (openBlock(), createBlock(unref(Ye), {
                key: 0,
                class: "fixed top-0 z-800 h-full w-full",
                open: isOpen.value,
                onClose: _cache[0] || (_cache[0] = ($event) => _ctx.notCloseOnClick ? null : isOpen.value = false)
            }, {
                default: withCtx(() => [
                    _cache[1] || (_cache[1] = createBaseVNode("div", {class: "absolute inset-0 bg-dark/60"}, null, -1)),
                    createBaseVNode("div", _hoisted_1, [
                        createVNode(unref(Ge), mergeProps(_ctx.$attrs, {class: "pointer-events-auto relative w-50% rounded-lg bg-light-200 shadow-xl"}), {
                            default: withCtx(() => [
                                renderSlot(_ctx.$slots, "default")
                            ]),
                            _: 3
                        }, 16)
                    ])
                ]),
                _: 3
            }, 8, ["open"])) : createCommentVNode("", true);
        };
    }
});
export {
    _sfc_main as _
};
